<template>
	<div class="app-container">
		<div class="policyquery">
			<!-- <div class="tabs">
        	<div class="tabs1" v-bind:class="{'now':now == 1}" @click="changeTabs(1)">全部</div>
        	<div class="tabs2" v-bind:class="{'now':now == 2}" @click="changeTabs(2)">近90天到期的保单</div>
        </div> -->
			<div class="allBox clearfix">
				<div class="allCon">
					<div class="importBox clearfix clearfix_top" :class="{'show':toExpand,'hide':!toExpand,'verser':keyi}">
						<!--'toExpand?'show':'hide'-->
						<el-form :model="formLabel" :inline="true" class='inputBox' :label-position="toLeft" label-width="78px">
							<div class="box1" v-if='now == 1'>
								<el-form-item>
									<label class="addlabel">时&emsp;&emsp;间 </label>
									<el-select v-model="formLabel.DateType" placeholder="请选择" size="mini" class='wd95 media'>
										<el-option v-for="item in timeOptions" :key="item.id" :label="item.value" :value="item.id">
										</el-option>
									</el-select>
									<el-date-picker v-model="timeCon" type="daterange" class="media" start-placeholder="开始日期" end-placeholder="结束日期" @change='getTimeCon' value-format='yyyy-MM-dd' :default-time="['00:00:00', '23:59:59']" size="mini" :picker-options="pickerOptions">
									</el-date-picker>
								</el-form-item>

								<el-form-item label="保险公司" style="position: relative;left: -42px;">
									<el-select v-model="formLabel.InsurancesId" placeholder="请选择" size="mini" class='wd180' @change='getInsuranceStaff'>
										<el-option-group v-for="group in Insurancelist" :key="group.letter" :label="group.letter">
											<el-option v-for="item in group.insurances" :key="item.id" :label="item.insuranceName" :value="item.id">
											</el-option>
										</el-option-group>
									</el-select>
								</el-form-item>
								<div class="search">
									<el-form-item>
										<label class="addlabel">搜&emsp;&emsp;索 </label>
										<el-input v-model="formLabel.QueryKeyword" @keyup.enter.native='searchList()' placeholder="请输入保单号/车牌号/车架号/被保险人" size="mini" class="wd210"></el-input>
									</el-form-item>
								</div>
							</div>
							<!-- <div class="box1" v-if='now == 2'>
		    				<el-form-item label="时间"  label-width="60px">
		    					<el-select v-model="formLabel.DateType" placeholder="请选择" disabled size="mini" class='wd130'>
								    <el-option
								      v-for="item in timeOptions"
								      :key="item.id"
								      :label="item.value"
								      :value="item.id">
								    </el-option>
								</el-select>
		    					<el-date-picker
							      v-model="timeCon90"
							      type="daterange"
							      :default-time="['00:00:00', '23:59:59']" size="mini" readonly>
							    </el-date-picker>
		    				</el-form-item>
		    				<div class="search">
		    				  <el-form-item label="搜索"  label-width="60px">
					            <el-input v-model="formLabel.QueryKeyword" placeholder="请输入保单号/车牌号/车架号/被保险人" size="mini"  class="wd260"></el-input>
					          </el-form-item>
		    				</div>
		    			</div> -->
							<div class="expandbox">
								<div class="box3">
									<p>保单查询信息</p>
									<div class="searchInfo">
										<div class="row3 clearfixs">
											<!-- <div class="rh">
			    							<el-form-item label="业务来源">
						    				<el-select v-model="BusinessSources" placeholder="请选择" size="mini" class='wd210'>
											    <el-option
											      v-for="item in transOptions"
											      :key="item.id"
											      :label="item.value"
											      :value="item.id">
											    </el-option>
											</el-select>
											</el-form-item>
			    						</div> -->
											<div class="rh">
												<el-form-item label="保险类型">
													<el-select v-model="formLabel.InsuranceType" placeholder="请选择" size="mini" class='wd210'>
														<el-option v-for="item in InsuranceTypes" :key="item.id" :label="item.value" :value="item.id">
														</el-option>
													</el-select>
												</el-form-item>
											</div>
											<div class="rh">
												<el-form-item label="组织机构">

													<ztree-select class="wd180" v-model="formLabel.OrganizationUnitId" :treedata="treeData" :childprops="childprops" @change='setSelectedId'></ztree-select>

												</el-form-item>
											</div>

											<div class="rh rh2">
												<el-form-item label="业务类型">
													<el-select v-model="formLabel.BusinessType" placeholder="请选择" size="mini" class='wd210'>
														<el-option v-for="item in BusinessTypes" :key="item.values" :label="item.name" :value="item.values">
														</el-option>
													</el-select>
												</el-form-item>
											</div>
										</div>
										<div class="row3 clearfixs">
											<div class="rh">
												<el-form-item label="保单类型">
													<el-select v-model="formLabel.GuaranteeSlipType" placeholder="请选择" size="mini" class='wd210'>
														<el-option v-for="item in GuaranteeSlipTypes" :key="item.id" :label="item.value" :value="item.type">
														</el-option>
													</el-select>
												</el-form-item>
											</div>
											<div class="rh">
												<el-form-item label="业务归属">
													<el-select v-model="formLabel.BusinessOrganzationid" filterable placeholder="请选择" size="mini" class="wd180 wd210s">
														<el-option v-for="item in userlist" :key="item.organzationId" :label="item.organzationName" :value="item.organzationId">
														</el-option>
													</el-select>
												</el-form-item>
											</div>
											<div class="rh">
												<el-form-item label="出单工号">
													<el-select v-model="formLabel.StaffId" placeholder="请选择" size="mini" class='wd210'>
														<el-option v-for="item in InsuranceStafflist" :key="item.id" :label="item.staffAccount" :value="item.id">
														</el-option>
													</el-select>
												</el-form-item>
											</div>
										</div>
										<!-- <div class="row3 clearfixs">
			    						
			    						<div class="rh">
			    							<el-form-item label="业务类型">
						    				<el-select v-model="formLabel.BusinessType" placeholder="请选择" size="mini" class='wd210'>
											    <el-option
											      v-for="item in BusinessTypes"
											      :key="item.values"
											      :label="item.name"
											      :value="item.values">
											    </el-option>
											</el-select>
											</el-form-item>
			    						</div>
			    					</div> -->

									</div>
								</div>
								<div class="box2">
									<p>车辆查询信息</p>
									<div class="carInfo">
										<div class="row1 clearfixs">
											<div class="lf">
												<el-form-item label="核载质量">
													<el-input v-model="formLabel.LoadQualityMin" placeholder="最小值" size="mini" class="wd90"></el-input>
													<span>到</span>
													<el-input v-model="formLabel.LoadQualityMax" placeholder="最大值" size="mini" class="wd90"></el-input>
												</el-form-item>
											</div>
											<div class="lf">
												<el-form-item label="车　　价">
													<el-input v-model="formLabel.PurchasePricMin" placeholder="最小值" size="mini" class="wd90"></el-input>
													<span>到</span>
													<el-input v-model="formLabel.PurchasePricMax" placeholder="最大值" size="mini" class="wd90"></el-input>
												</el-form-item>
											</div>
											<div class="lf">
												<el-form-item label="出险次数">
													<el-input v-model="formLabel.InsuranceTimeMin" placeholder="最小值" size="mini" class="wd90"></el-input>
													<span>到</span>
													<el-input v-model="formLabel.InsuranceTimeMax" placeholder="最大值" size="mini" class="wd90"></el-input>
												</el-form-item>
											</div>
										</div>
										<div class="row2 clearfixs">
											<div class="lf">
												<el-form-item>
													<label class="addlabel">车&ensp;船&ensp;税 </label>
													<el-input v-model="formLabel.VehicleAndVesselMin" placeholder="最小值" size="mini" class="wd90"></el-input>
													<span>到</span>
													<el-input v-model="formLabel.VehicleAndVesselMax" placeholder="最大值" size="mini" class="wd90"></el-input>
												</el-form-item>
											</div>
											<div class="md">
												<el-form-item label="厂牌型号">
													<el-input v-model="formLabel.BrandModel" placeholder="请输入厂牌型号" size="mini" class="wd210"></el-input>
												</el-form-item>
											</div>
											<div class="rh">
												<el-form-item label="是否过户车">
													<el-select v-model="formLabel.IsTransfer" placeholder="请选择" size="mini" class='wd210'>
														<el-option v-for="item in transOptions" :key="item.id" :label="item.value" :value="item.id">
														</el-option>
													</el-select>
												</el-form-item>
											</div>
										</div>
									</div>
								</div>

								<!--<div class="box4">
			    				<p>保单查询信息</p>
			    				<div class="searchInfo">
			    					<div class="row3 clearfix">
			    						<div class="rh">
			    							<el-form-item label="上游结算状态">
						    				<el-select v-model="formLabel.DocumentState" placeholder="请选择" size="mini" class='wd210'>
											    <el-option
											      v-for="item in DocumentStates"
											      :key="item.id"
											      :label="item.value"
											      :value="item.id">
											    </el-option>
											</el-select>
											</el-form-item>
			    						</div>
			    						<div class="rh">
			    							<el-form-item label="下游结算状态">
						    				<el-select v-model="formLabel.DocumentState" placeholder="请选择" size="mini" class='wd210'>
											    <el-option
											      v-for="item in DocumentStates"
											      :key="item.id"
											      :label="item.value"
											      :value="item.id">
											    </el-option>
											</el-select>
											</el-form-item>
			    						</div>
			    						<div class="rh rh2">
			    							<el-form-item label="保单备注">
									           <el-input v-model="formLabel.Remark" placeholder="请输入保单备注" size="mini"  class="wd210"></el-input>
									        </el-form-item>
			    						</div>
			    					</div>
			    				</div>
			    			</div>-->
							</div>
						</el-form>

					</div>
					<!-- dialog导出 -->
					<!-- <el-dialog title="选择导出项：" :visible.sync="dialogExportVisible" :close-on-click-modal='false' width="600px">
					<div class="dialogcon">
						<el-checkbox-group v-model="checkList">
							<el-checkbox :label="aa"></el-checkbox>
							<el-checkbox label="复选框 B"></el-checkbox>
							<el-checkbox label="复选框 C"></el-checkbox>
							<el-checkbox label="禁用"></el-checkbox>
							<el-checkbox label="选中且禁用"></el-checkbox>
						</el-checkbox-group>
					</div>
					<div style="margin:0;color:#cf1212;line-height:18px;height:30px;"><span v-if='errortip'>请选择要导出的项</span></div>
					<div style="text-align:center;">
						<el-button type="primary" size="mini" :loading='dloading' @click="toExcel">确定</el-button>
					</div>
				</el-dialog> -->
					<!-- <div class='isExpand' v-if="toExpand">
					<img src="../../assets/images/more_arrow1.png"  @click='isExpand'/><p></p>
				</div>
				
				<div class='isnExpand' v-if="!toExpand">
					<img src="../../assets/images/more_arrow2.png"  @click='isExpand'/><p></p>
				</div> -->
					<div class="querybtn" style="text-align:right">
						<!--v-bind:class="{'btnBox':!toExpand,'btnBox2':toExpand}" v-if="isshows"-->

						<div>
							<div style="float:left;cursor: pointer;color: #027dca;font-weight: 700; padding: 0px 20px 0;line-height: 29px;" v-if="toExpand" @click='isExpand'><span>更多条件 <i class="iconfont icon-bottom"></i></span></div>
							<div style="float:left;cursor: pointer;color: #027dca;font-weight: 700; padding: 0px 20px 0;line-height: 29px;" v-if="!toExpand" @click='isExpand'><span>收起 <i class="iconfont icon-up"></i></span></div>
							<el-button size="mini" type='primary' @click='searchList()' style="width:80px;">搜索</el-button>
							<!--<el-button size="mini" @click='toExcel()'><i class="iconfont icon-daochu"></i>&nbsp;导出</el-button>-->
							<el-dropdown placement='bottom-end' class="day-dropdown">
								<el-button type="primary" size="mini" style="height:29px;">
									导出<i class="el-icon-arrow-down el-icon--right"></i>
								</el-button>
								<el-dropdown-menu slot="dropdown">
									<el-dropdown-item v-for="(item,index) in dropdownS">
										<div @click="toexport(item.id)">{{item.templateName}}</div>
									</el-dropdown-item>
									<el-dropdown-item divided>
										<div style="width:120px;" @click="toInsurance">模板设置</div>
									</el-dropdown-item>
								</el-dropdown-menu>
							</el-dropdown>
						</div>
					</div>
					<div class="totalInfo">
						<p><i class="iconfont icon-prompt totalInfo_nums"></i>&nbsp;&nbsp;共
							<span class="totalInfo_num">{{totalCount}} </span>辆机动车 &nbsp;<span class="totalInfo_line">,</span>&nbsp;&nbsp;
							<span class="totalInfo_num">{{TotalGuaranteeSlipCount}} </span>个保单 &nbsp;<span class="totalInfo_line">,</span>&nbsp; 总保费
							<span class="totalInfo_num">￥{{totalPremium | numFilter}}</span> 万元&nbsp;<span class="totalInfo_line">,</span>&nbsp; 净保费
							<span class="totalInfo_num">￥{{totalNetPremium | numFilter}}</span> 万元&nbsp;

							<!-- |&nbsp; 车船税￥{{vehicleAndVesselTax}} -->
						</p>
					</div>
					<div class="listBox">
						<div class="util-table">
							<table class="util-tb" v-loading="loading" :element-loading-text="daochutext">
								<tr>
									<th width="140">车牌号</th>
									<th width="220">保单号</th>
									<th width="50" style="text-align:center">类型</th>
									<th width="150" style="text-align:right">保费/车船税 (元)</th>
									<th width="140" style="text-align:center">签单日期</th>
									<th width="220">工号</th>
									<th width="170">业务归属</th>
									<th width="80" class="edits">操作</th>
								</tr>
								<tr v-for="item in carlist" v-if="item.staffIsSame">
									<td class="util-tab carId carId1" v-if="item.plateColor=='黑'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId2" v-else-if="item.plateColor=='白'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId3" v-else-if="item.plateColor=='绿'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId4" v-else-if="item.plateColor=='黄'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId5" v-else-if="item.plateColor=='蓝'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId6" v-else>
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab" v-bind:class="{'ht60':item.insurances.length == 1}">

										<template v-for="ins in item.insurances">
											<a v-if="ins.guaranteeSlipTypeQuery==3" class='bonbors' :class="ins.guaranteeSlipTypeQuery==1?'businesscolor':''">
												<router-link class="all alls" tag="a" target="_blank" :to="{ name: 'endorsementDetail', params: { id:ins.guaranteeSlipId}}">{{ins.guaranteeSlipNumber}}
												</router-link>
											</a>
											<a v-else class='bonbors' :class="ins.guaranteeSlipTypeQuery==1?'businesscolor':''">
												<router-link class="all alls" tag="a" target="_blank" :to="{ name: 'policydetail', params: { id:ins.guaranteeSlipId}}">{{ins.guaranteeSlipNumber}}
												</router-link>
											</a>
										</template>

									</td>
									<td class="util-tab tocenter">
										<div v-for="ins in item.insurances" class="bonbors">
											<div class="all type1 all_equally" v-if="ins.guaranteeSlipTypeQuery==2">
												<img src="../../assets/images/icon-jiaoqiang.png" />
											</div>
											<div class="all type2 all_equally" v-if="ins.guaranteeSlipTypeQuery==1">
												<img src="../../assets/images/icon-shangye.png" />
											</div>
											<div class="all type3 all_equally" v-if="ins.guaranteeSlipTypeQuery==3">
												<img src="../../assets/images/icon-pidan.png" />
											</div>
										</div>
									</td>
									<td class="util-tab money">
										<div v-for="ins in item.insurances" class="bonbors">
											<div class="all" v-if="ins.guaranteeSlipTypeQuery==1"><span>{{ins.totalPremium | numFilter}}</span></div>
											<div class="all" v-if="ins.guaranteeSlipTypeQuery==2"><span>{{ins.totalPremium | numFilter}} / {{ins.vehicleAndVesselTax | numFilter}}</span></div>
											<div class="all add" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium != null && ins.correctPremium > 0"><span>+{{ins.totalPremium | numFilter}}</span></div>

											<div class="all" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium == null"><span>-</span></div>
											<div class="all dess" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium!=null && ins.correctPremium<0"><span>{{ins.correctPremium | numFilter}}</span></div>

										</div>
									</td>
									<td class="util-tab" style="text-align:center">
										<div class="bonbors" v-for="ins in item.insurances">
											<div class="all allcents">{{ins.signDate | subFilter}}</div>
										</div>
									</td>
									<td class="util-tab">
										<span class="toBlock">{{item.insurances[0].insuranceName}}
										</span>
										<!--<el-tooltip class="item" effect="light" placement="top">
											<div slot="content">
												{{item.insurances[0].insuranceName}}-{{item.insurances[0].staffAccount}}-({{item.insurances[0].describe}})
											</div>
											<div>
											
											<span class="worknumest" style="display:block;">{{item.insurances[0].staffAccount}} ({{item.insurances[0].describe}})</span></div>
										</el-tooltip>-->
										<div><span class="worknumest" style="display:block;">{{item.insurances[0].staffAccount}} ({{item.insurances[0].describe}})</span></div>
										<!-- </el-tooltip> -->
									</td>
									<td class="util-tab">
										<span class="toBlock" v-if="item.insurances[0].charger">{{item.insurances[0].charger}}</span>
										<span class="toBlock" v-else>-</span>
										<el-tooltip class="item" effect="light" placement="top" v-if="item.insurances[0].chargerOrganizationName">
											<div slot="content" class='compony_text'>
												{{item.insurances[0].userPolicyOrganizationUnit}}
											</div>
											<span class="companytest">{{item.insurances[0].chargerOrganizationName}}</span>
										</el-tooltip>
										<span class="companytest" v-else>-</span>
									</td>
									<td class="util-tab">
										<div class="all edits" v-for="ins in item.insurances">
											<span class="edit">
												<a v-if="ins.guaranteeSlipTypeQuery==3">
													<router-link tag="a" target="_blank" class="all alls" :to="{ name: 'endorsementDetail', params: { id:ins.guaranteeSlipId}}">详情
													</router-link>
												</a>
												<a v-else>
													<router-link tag="a" target="_blank" class="all alls" :to="{ name: 'policydetail', params: { id:ins.guaranteeSlipId}}">详情
													</router-link>
												</a>
											</span>
											<!--<span class="del">删除</span>-->
										</div>
									</td>
								</tr>
								<tr v-for="item in carlist" v-if="!item.staffIsSame">
									<td class="util-tab carId carId1" v-if="item.plateColor=='黑'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId2" v-else-if="item.plateColor=='白'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId3" v-else-if="item.plateColor=='绿'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId4" v-else-if="item.plateColor=='黄'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId5" v-else-if="item.plateColor=='蓝'">
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab carId carId6" v-else>
										<span>{{item.plateNumber | addtrims}}</span>
									</td>
									<td class="util-tab util-tabs" v-bind:class="{'ht60':item.insurances.length == 1}">
										<template v-for="ins in item.insurances">
											<a v-if="ins.guaranteeSlipTypeQuery==3" class='bonbors'>
												<router-link tag="a" target="_blank" class="all alls" :to="{ name: 'endorsementDetail', params: { id:ins.guaranteeSlipId}}">{{ins.guaranteeSlipNumber}}
												</router-link>
											</a>
											<a v-else class='bonbors'>
												<router-link tag="a" target="_blank" class="all alls" :to="{ name: 'policydetail', params: { id:ins.guaranteeSlipId}}">{{ins.guaranteeSlipNumber}}
												</router-link>
											</a>
										</template>

										<!--<div class="all spilname" v-for="ins in item.insurances">{{ins.guaranteeSlipNumber}}</div>-->
									</td>

									<td class="util-tab util-tabs">
										<div v-for="ins in item.insurances">
											<div class="spilnames type1" v-if="ins.guaranteeSlipTypeQuery==2">
												<img src="../../assets/images/icon-jiaoqiang.png" />
											</div>
											<div class="spilnames type2" v-if="ins.guaranteeSlipTypeQuery==1">
												<img src="../../assets/images/icon-shangye.png" />
											</div>
											<div class="spilnames type3" v-if="ins.guaranteeSlipTypeQuery==3">
												<img src="../../assets/images/icon-pidan.png" />
											</div>
										</div>
									</td>
									<td class="util-tab util-tabs money">
										<div v-for="ins in item.insurances" class="bonbors">

											<!--<div class="all" v-if="ins.guaranteeSlipTypeQuery==2"><span>{{ins.totalPremium | numFilter}} / {{ins.vehicleAndVesselTax | numFilter}}</span></div>
										<div class="all" v-if="ins.guaranteeSlipTypeQuery==1"><span>{{ins.totalNetPremium | numFilter}}</span></div>
										<div class="all add" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium != null && ins.correctPremium > 0"><span>+{{ins.correctPremium | numFilter}}</span></div>
										<div class="all" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium == null"><span>-</span></div>
										<div class="all dess" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium!=null && ins.correctPremium<0"><span>{{ins.correctPremium | numFilter}}</span></div>
									-->
											<div class="all spilname_right" v-if="ins.guaranteeSlipTypeQuery==1&&ins.totalPremium"><span>{{ins.totalPremium | numFilter}}</span></div>
											<div class="all spilname_right" v-if="ins.guaranteeSlipTypeQuery==1&&!ins.totalPremium"><span>-</span></div>
											<div class="all spilname_right" v-if="ins.guaranteeSlipTypeQuery==2"><span>{{ins.totalPremium | numFilter}} / {{ins.vehicleAndVesselTax | numFilter}}</span></div>
											<div class="all spilname_right" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium == null"><span>-</span>3</div>
											<div class="all spilname_right dess" v-if="ins.guaranteeSlipTypeQuery==3 && ins.correctPremium != null && ins.correctPremium < 0"><span>{{ins.correctPremium | numFilter}}</span></div>

										</div>
									</td>
									<td class="util-tab util-tabs">
										<div class="all spilname_cen" v-for="ins in item.insurances"><span>{{ins.signDate | subFilter}}</span></div>
									</td>
									<td class="util-tab util-tabs">
										<div class="spilname" v-for="ins in item.insurances">
											<span class="toBlock">{{ins.insuranceName}}
											</span>
											<!--<el-tooltip class="item" effect="light" placement="top">
										<div slot="content">{{ins.insuranceName}}-{{ins.staffAccount}}({{ins.describe}})</div>
										<div span class="worknumest" style="display:block;">{{ins.staffAccount}}({{ins.describe}})</div>
										</el-tooltip>-->
											<div span class="worknumest" style="display:block;">{{ins.staffAccount}}({{ins.describe}})</div>
										</div>
									</td>
									<td class="util-tab util-tabs">
										<div class="spilname" v-for="ins in item.insurances">
											<span class="toBlock">{{ins.userName}}</span>
											<el-tooltip class="item" effect="light" placement="top">
												<div slot="content" class='compony_text'>{{ins.userPolicyOrganizationUnit}}</div>
												<span class="companytest">{{ins.userPolicyOrganizationUnit | Subsidiary}}</span>
											</el-tooltip>
										</div>
									</td>
									<td class="util-tab util-tabs">
										<!--<div class="all edits" v-for="ins in item.insurances">
										<span class="edit" @click="toEdit(ins.guaranteeSlipId)">详情</span>
										
									</div>-->

										<div class="all spilname_ben" v-for="ins in item.insurances">
											<span class="edit">
												<a v-if="ins.guaranteeSlipTypeQuery==3">
													<router-link class="all alls" tag="a" target="_blank" :to="{ name: 'endorsementDetail', params: { id:ins.guaranteeSlipId}}">详情
													</router-link>
												</a>
												<a v-else>
													<router-link class="all alls" tag="a" target="_blank" :to="{ name: 'policydetail', params: { id:ins.guaranteeSlipId}}">详情
													</router-link>
												</a>
											</span>

											<!--<span class="edit" @click="toEdit(ins.guaranteeSlipId)">编辑&nbsp;&nbsp;</span>
										<span class="del" >删除</span>-->
										</div>
									</td>
								</tr>

							</table>
						</div>
						<div class="list-page">
							<el-pagination @current-change="handleCurrentChange" :current-page='currentPage' background :page-size="10" layout="total,prev, pager, next" :total="pagetotal"></el-pagination>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import Vue from "vue";
import treeSelect from "@/components/tree-select/tree.vue";
import ztreeSelect from "@/components/z-select/index.vue";
export default {
  components: {
    treeSelect,
    ztreeSelect
  },
  data() {
    return {
      aa: "124",
      keyi: false,
      dialogExportVisible: false,
      checkList: [],
      dloading: false,
      errortip: false,
      childprops: {
        name: "displayName", //显示名字
        children: "orgs", //子级字段名
        lv: "depth" //当前层级
      },
      isshows: true,
      now: 1, //tabs切换
      toExpand: true, //是否隐藏
      timeOptions: [
        {
          id: 1,
          type: 1,
          value: "支付日期"
        },
        {
          id: 2,
          type: 2,
          value: "签单日期"
        },
        {
          id: 3,
          type: 3,
          value: "核保日期"
        },
        {
          id: 4,
          type: 4,
          value: "保单起保日期"
        },
        {
          id: 5,
          type: 5,
          value: "保单到期日期"
        },
        {
          id: 6,
          type: 6,
          value: "登记系统日期"
        },
        {
          id: 7,
          type: 7,
          value: "下游结算日期"
        },
        {
          id: 8,
          type: 8,
          value: "上游结算日期"
        } //时间数据
      ],
      pickerOptions: {
        shortcuts: [
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近90天",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            }
          }
        ]
      }, //快捷选项
      timeCon: [], //时间具体区间
      timeCon90: [], //90天的
      BeginDate: "", //开始
      EndDate: "", //结束
      searchCon: "", //搜索内容
      toLeft: "left", //label的对齐方式
      transOptions: [
        //过户车数据
        {
          id: "",
          value: "不限"
        },
        {
          id: "332E8CBF-5629-4493-B4C5-5099924D20D9",
          value: "是"
        },
        {
          id: "F92A5CAE-ACEB-4632-B2B3-4D52C725B433",
          value: "否"
        }
      ],
      formLabel: {
        //PageSize:10, //每页条数
        PageIndex: 1, //当前页码
        QueryType: 1, //类型，1为全部，2为90
        //IsShortSearch:true, //默认条件查询
        QueryKeyword: "", //查询搜索框的内容，保单号/车牌号/车架号/被保险人
        LoadQualityMin: "", //核载质量小
        LoadQualityMax: "", //核载质量大
        PurchasePricMin: "", //车价小
        PurchasePricMax: "", //车价大
        InsuranceTimeMin: "", //出险次数小
        InsuranceTimeMax: "", //出险次数大
        VehicleAndVesselMin: "", //车船税小
        VehicleAndVesselMax: "", //车船税大
        BrandModel: "", //厂牌型号
        IsTransfer: "", //过户车
        BusinessOrganzationid: "", //业务员
        InsurancesId: "", //保险公司id
        StaffId: "", // 工号id
        OrganizationUnitId: "", //组织部门id
        GuaranteeSlipType: "", //保单类型
        BusinessType: "", //业务类型
        InsuranceType: "", //保险类型
        DateType: 1, //时间type
        BeginDate: "", //开始
        EndDate: "", //结束
        DocumentState: 0 //状态
        //Remark:'', //备注
      }, //表单
      userlist: [], //业务员数据
      Insurancelist: [], //保险公司
      InsuranceStafflist: [], //工号
      GuaranteeSlipTypes: [
        {
          id: "",
          type: "",
          value: "不限"
        },
        {
          id: 1,
          type: "1",
          value: "保单"
        },
        {
          id: 2,
          type: "2",
          value: "批单"
        }
      ], //保单类型数据
      InsuranceTypes: [
        {
          id: "",
          value: "不限"
        },
        {
          id: "1",
          value: "商业"
        },
        {
          id: "2",
          value: "交强"
        }
      ], // 保险类型数据
      BusinessTypes: [
        //					{
        //						"id":"",
        //						"value":'不限'
        //					},
        //					{
        //					   "id":"063330BD-9D99-48FC-90BE-76F8E124DC2A",
        //					   "value":"旧车首保"
        //					},
        //					{
        //					   "id":"7137B961-599C-4AA8-8239-5A85A736DC5A",
        //					   "value":"新保"
        //					},
        //					{
        //					   "id":"0B438864-1826-452F-9959-4304544A1B3E",
        //					   "value":"转保"
        //					},
        //					{
        //					   "id":"6046BEC1-D165-4CB9-A4A4-81FE035B65B4",
        //					   "value":"续保自己"
        //					},
        //					{
        //					   "id":"6013A0D5-9967-47EA-8976-2F94B533439C",
        //					   "value":"续保其它"
        //					}
      ], //业务类型数据
      BusinessSources: "", //业务来源
      treeSelected: "",
      treeProps: {
        label: "displayName",
        children: "orgs",
        level: "depth",
        value: "id"
      }, //树属性
      treeData: [], //树数据
      DocumentStates: [
        {
          id: 0,
          type: "0",
          value: "不限"
        },
        {
          id: 1,
          type: "1",
          value: "已结算"
        },
        {
          id: 2,
          type: "2",
          value: "未结算"
        }
      ], //结算状态
      carlist: [], //车辆列表
      pagetotal: null, //总条数
      currentPage: 1, //当前页码
      totalCount: 0, //总记录
      TotalGuaranteeSlipCount: 0,
      totalPremium: 0, //总保费
      totalNetPremium: 0, //净保费
      vehicleAndVesselTax: 0, //车船税
      filePath: "", //导出路径
      loading: true,
      daochutext: "",
      dropdownS: [], //下拉
      notifying:null
    };
  },
  mounted() {
    var that = this;
    that.getInsurance();
    this.getBusinesstype(this.formLabel.InsurancesId);
    new Promise(function(reslove, reject) {
      that.getUnits();
      reslove();
    })
      .then(function() {
        return new Promise(function(res, rej) {
          that.timeCon = [];
          if (that.$route.query.PageIndex) {
            console.log("luyou1------------------------");
            console.warn(that.$route.query.DateType);
            console.log(typeof that.$route.query.DateType);
            for (let k in that.$route.query) {
              for (let j in that.formLabel) {
                if (k == j) {
                  Vue.set(that.formLabel, j, that.$route.query[k]);
                  if (k == "DateType") {
                    Vue.set(that.formLabel, j, Number(that.$route.query[k]));
                  }
                  if (k == "BeginDate") {
                    that.timeCon.push(that.$route.query.BeginDate);
                    that.timeCon.push(that.$route.query.EndDate);
                  }
                  if (k == "InsurancesId") {
                    that.getInsuranceStaff(that.$route.query.InsurancesId);
                    that.getBusinesstype(that.formLabel.InsurancesId);
                  }

                  if (k == "BusinessOrganzationid") {
                    setTimeout(function() {
                      console.log("ooooooooooooooooooooooooooooooooooooo");

                      Vue.set(
                        that.formLabel,
                        "BusinessOrganzationid",
                        parseFloat(that.$route.query.BusinessOrganzationid)
                      );
                      console.log(that.formLabel.BusinessOrganzationid);
                    }, 500);
                  }
                  if (
                    k == "DocumentState" ||
                    k == "PageIndex" ||
                    k == "QueryType" ||
                    k == "DateType" ||
                    k == "QueryKeyword" ||
                    k == "BeginDate" ||
                    k == "EndDate" ||
                    k == "InsurancesId"
                  ) {
                  } else {
                    that.toExpand = false;
                    setTimeout(function() {
                      that.keyi = true;
                    }, 1000);
                  }
                }
              }
            }
            console.log(that.formLabel);
            that.currentPage = Number(that.$route.query.PageIndex);
          } else {
            that.currentPage = 1;
          }
          res();
        });
      })
      .then(function() {
        setTimeout(function() {
          that.getdata();
        }, 500);
      });
    this.getUserList();
    this.downExport();
    console.log("车辆列表");
    console.log(this.carlist);
  },
  watch: {
    $route(to, from) {
      var that = this;
      this.timeCon = [];
      for (let k in this.$route.query) {
        for (let j in this.formLabel) {
          if (k == j) {
            Vue.set(this.formLabel, j, this.$route.query[k]);
            if (k == "DateType") {
              Vue.set(this.formLabel, j, Number(this.$route.query[k]));
            }
            if (k == "BeginDate") {
              this.timeCon.push(this.$route.query.BeginDate);
              this.timeCon.push(this.$route.query.EndDate);
            }
            if (k == "InsurancesId") {
              this.getInsuranceStaff(this.$route.query.InsurancesId);
              this.getBusinesstype(this.formLabel.InsurancesId);
            }
            if (k == "BusinessOrganzationid") {
              setTimeout(function() {
                console.log("fuzhi");
                console.log(that.formLabel.BusinessOrganzationid);
                Vue.set(
                  that.formLabel,
                  "BusinessOrganzationid",
                  parseFloat(that.$route.query.BusinessOrganzationid)
                );
              }, 500);
            }
            //							if(k=="OrganizationUnitId"){
            //											that.getUsers(that.$route.query.OrganizationUnitId)
            //										}
            if (
              k == "DocumentState" ||
              k == "PageIndex" ||
              k == "QueryType" ||
              k == "DateType" ||
              k == "QueryKeyword" ||
              k == "BeginDate" ||
              k == "EndDate" ||
              k == "InsurancesId"
            ) {
            } else {
              this.toExpand = false;
              setTimeout(function() {
                this.keyi = true;
              }, 1000);
            }
          }
        }
      }
      if (this.$route.query.PageIndex) {
        this.currentPage = Number(this.$route.query.PageIndex);
      } else {
        this.currentPage = 1;
        Vue.set(this.formLabel, "PageIndex", 1);
      }
      console.log(22222);
      console.log(this.timeOptions);
      setTimeout(function() {
        that.getdata();
      }, 500);
    },
    "formLabel.OrganizationUnitId": {
      handler: function(val) {
        if (val != "") {
          Vue.set(this.formLabel, "OrganizationUnitId", val);
          Vue.set(this.formLabel, "BusinessOrganzationid", "");

          this.getUsers(val);
        } else {
          this.formLabel.OrganizationUnitId = "";
          Vue.set(this.formLabel, "BusinessOrganzationid", "");
          this.userlist = [];
        }
      },
      deep: true //深度监听
    },
    "formLabel.QueryKeyword": {
      handler: function(val) {
        let aa = val.trim();
        console.log(val);
        console.log(aa);
        //this.formLabel.QueryKeyword=aa
        Vue.set(this.formLabel, "QueryKeyword", aa);
      },
      deep: true //深度监听
    }
  },
  filters: {
    numFilter(val) {
      // 截取当前数据到小数点后两位
      // let realVal = Number(val).toFixed(2)
      // num.toFixed(2)获取的是字符串
      // return Number(realVal)
      if (val) {
        val = val.toString().replace(/\$|\,/g, "");
        if (isNaN(val)) {
          val = "0";
        }
        let sign = val == (val = Math.abs(val));
        val = Math.floor(val * 100 + 0.50000000001);
        let cents = val % 100;
        val = Math.floor(val / 100).toString();
        if (cents < 10) {
          cents = "0" + cents;
        }
        for (var i = 0; i < Math.floor((val.length - (1 + i)) / 3); i++) {
          val =
            val.substring(0, val.length - (4 * i + 3)) +
            "," +
            val.substring(val.length - (4 * i + 3));
        }

        return (sign ? "" : "-") + val + "." + cents;
      }
    },
    addtrims(val) {
      if (val == "未上牌") {
        return val;
      } else {
        let str1 = val.slice(0, 2);
        let str2 = val.slice(2, val.length);
        return str1 + " " + str2;
      }
    },
    subFilter(val) {
      if (val) {
        return val.substr(0, 10);
      }
    },
    Subsidiary(val) {
      if (val) {
        let aa = val.split("-");
        return aa[aa.length - 1];
      }
    },
    Subsidiarys(val) {
      let aa = val.indexOf("-");
      let str = val.slice(aa + 1, val.length);
      return str;
    }
  },
  methods: {
    //			//切换
    //			changeTabs(val){
    //				this.now = val;
    //				if(this.now == 1){
    //					//全部
    //					this.formLabel.DateType = 1;
    //					this.formLabel.QueryType = 1;
    //				}else if(this.now == 2){
    //					this.formLabel.DateType = 5;
    //					this.formLabel.QueryType = 2;
    //					this.BeginDate = this.getNow();
    //					this.formLabel.BeginDate = this.BeginDate;
    //					this.EndDate = this.get90();
    //					this.formLabel.EndDate = this.EndDate;
    //					console.log(this.BeginDate)
    //					console.log(this.EndDate);
    //					let arr = [];
    //					arr.push(this.BeginDate);
    //					arr.push(this.EndDate);
    //					this.timeCon90 = arr;
    //				}
    //			},
    //展开
    isExpand() {
      this.toExpand = !this.toExpand;
      var that = this;
      this.isshows = false;
      setTimeout(function() {
        that.isshows = true;
      }, 800);
      if (!this.toExpand) {
        setTimeout(function() {
          that.keyi = true;
        }, 1000);
      } else {
        that.keyi = false;
      }
    },
    //当前时间
    getNow() {
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      var hour = date.getHours();
      var minute = date.getMinutes();
      var second = date.getSeconds();
      return year + "-" + month + "-" + day;
    },
    get90() {
      var now = new Date();
      var date = new Date(now.getTime() + 90 * 24 * 3600 * 1000);
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      var hour = date.getHours();
      var minute = date.getMinutes();
      var second = date.getSeconds();
      return year + "-" + month + "-" + day;
    },
    getTimeCon() {
      console.log(this.timeCon);
      if (this.timeCon) {
        this.formLabel.BeginDate = this.timeCon[0];
        this.formLabel.EndDate = this.timeCon[1];
      } else {
        this.formLabel.BeginDate = "";
        this.formLabel.EndDate = "";
      }
    },
    // 日期格式化
    formatTime(time, format = "YY-MM-DD hh:mm:ss") {
      var date = new Date(time);

      var year = date.getFullYear(),
        month = date.getMonth() + 1, //月份是从0开始的
        day = date.getDate(),
        hour = date.getHours(),
        min = date.getMinutes(),
        sec = date.getSeconds();
      var preArr = Array.apply(null, Array(10)).map(function(elem, index) {
        return "0" + index;
      }); ////开个长度为10的数组 格式为 00 01 02 03

      var newTime = format
        .replace(/YY/g, year)
        .replace(/MM/g, preArr[month] || month)
        .replace(/DD/g, preArr[day] || day)
        .replace(/hh/g, preArr[hour] || hour)
        .replace(/mm/g, preArr[min] || min)
        .replace(/ss/g, preArr[sec] || sec);

      return newTime;
    },
    //业务员
    getUsers(val) {
      let params = {
        organzationId: val
      };
      this.post(params, "services/app/common/CurrentBusinessAscription").then(
        rs => {
          if (rs.success) {
            let result = rs.result.items;
            this.userlist = result;
            // this.formLabel.UserId=rs.result.items[0].organzationId
          }
        }
      );
    },
    getUserList() {
      this.post({}, "services/app/common/CurrentBusinessAscription").then(
        rs => {
          if (rs.success) {
            let result = rs.result.items;
            this.userlist = result;
            //  this.formLabel.UserId=rs.result.items[0].organzationId
          }
        }
      );
    },
    //保险公司
    getInsurance() {
      let params = {};
      let all = {
        letter: "",
        insurances: [
          {
            id: "",
            insuranceName: "不限"
          }
        ]
      };
      this.post(params, "services/app/common/GetGroupInsurances").then(rs => {
        if (rs.success) {
          console.log("baoxiangongsi");
          console.log(rs.result.items);
          let result = rs.result.items;
          result.unshift(all);
          this.Insurancelist = result;
        }
      });
    },
    //获取业务类型数据
    getBusinesstype(val) {
      this.formLabel.BusinessType = "";
      let params = {
        id: val
      };
      let all = {
        values: "",
        name: "不限"
      };
      this.post(
        params,
        "services/app/guaranteeSlip/GetDictionaryGetInsuranceBusinessType"
      ).then(rs => {
        if (rs.success) {
          console.log(987654);
          console.log(rs);
          rs.result.unshift(all);
          this.BusinessTypes = rs.result;
        } else {
          this.$notify.error({
            title: "错误",
            message: res.error.message
          });
        }
      });
    },
    //工号
    getInsuranceStaff(val) {
      this.getBusinesstype(val);
      let arrtrim = [];
      this.InsuranceStafflist = arrtrim;
      this.formLabel.StaffId = "";
      if (val) {
        let params = {
          id: val
        };
        let all = {
          describe: "",
          id: "",
          staffAccount: "不限"
        };
        this.post(params, "services/app/common/GetCurrentInsuranceStaffs").then(
          rs => {
            if (rs.success) {
              let result = rs.result.items;
              console.log("num");
              console.log(result);
              result.unshift(all);

              this.InsuranceStafflist = result;
              for (var i = 0; i < this.InsuranceStafflist.length; i++) {
                if (this.InsuranceStafflist[i].describe) {
                  this.InsuranceStafflist[i].staffAccount =
                    this.InsuranceStafflist[i].staffAccount +
                    "（" +
                    this.InsuranceStafflist[i].describe +
                    "）";
                } else {
                  this.InsuranceStafflist[
                    i
                  ].staffAccount = this.InsuranceStafflist[i].staffAccount;
                }
              }
            }
          }
        );
      } else {
        let all = {
          describe: "",
          id: "",
          staffAccount: "不限"
        };
        console.log(2222);
        let arr = [];
        arr.push(all);
        this.InsuranceStafflist = arr;
        this.formLabel.StaffId = "";
      }
    },
    //组织机构
    getUnits() {
      let params = {
        queryType: 1
      };
      this.post(
        params,
        "services/app/common/GetCurrentOrganizationUnitsByType"
      ).then(rs => {
        console.log("组织机构" + rs);
        if (rs.success) {
          let data = rs.result;
          let arr = [];
          arr.push(data);
          this.treeData = arr;
          // console.log(rs.result);
          // console.log(this.treeData);
          // console.log('-----------');
        }
      });
    },
    setSelectedId(val) {
      this.getUsers(val);
      //		      if(val!=""){
      //		      		Vue.set(this.formLabel,'OrganizationUnitId',val)
      //			      	Vue.set(this.formLabel,'UserId',"")
      //			      	this.getUsers(val)
      //		      }else{
      //		      	this.formLabel.OrganizationUnitId=""
      //		      	Vue.set(this.formLabel,'UserId',"")
      //		      	this.userlist = [];
      //		      }
      //
      //
    },
    //		    // 获得列表
    //		    getList(page){
    //		    	const that = this;
    //		    	let params={
    //		    		"QueryType":1
    //		    	};
    //		    	if(page){
    //		    		params={
    //		    			"PageIndex" : page
    //		    		}
    //		    	}
    //		    	this.post(params, 'services/app/guaranteeSlip/QueryGuaranteeSlip').then(rs => {
    //					if (rs.success) {
    //						console.log("biaoshuju")
    //						console.log(rs.result.items)
    //						that.carlist = rs.result.items;
    //						let pagetotal = rs.result.totalCount
    //						that.pagetotal = pagetotal;  //页码
    //						that.totalCount = rs.result.totalCount;  //总记录
    //						that.totalPremium = rs.result.totalPremium;  //总保费
    //						that.totalNetPremium = rs.result.totalNetPremium;  //净保费
    //						that.vehicleAndVesselTax = rs.result.vehicleAndVesselTax  //车船税
    //						this.loading=false
    //					}
    //				})
    //		    },

    //sousuoshuju
    getdata() {
      console.log("huoqushuju");
      console.log(this.formLabel);
      var that = this;
      //		    	if(this.formLabel.BusinessType == '0'){
      //		    		this.formLabel.BusinessType = '';
      //		    	}
      //		    	if(this.formLabel.InsuranceType == '0'){
      //		    		this.formLabel.InsuranceType = '';
      //		    	}
      //		    	if(this.formLabel.IsTransfer == '0'){
      //		    		this.formLabel.IsTransfer = '';
      //		    	}
      //		    	if(this.formLabel.GuaranteeSlipType == '0'){
      //		    		this.formLabel.GuaranteeSlipType = '';
      //		    	}
      // this.formLabel.BusinessOrganzationid = ''
      this.post(
        this.formLabel,
        "services/app/guaranteeSlip/QueryGuaranteeSlip"
      ).then(rs => {
        if (rs.success) {
          console.log("carlist");
          console.log(rs);
          that.carlist = rs.result.items;
          let pagetotal = rs.result.totalCount;
          that.pagetotal = pagetotal; //页码
          that.totalCount = rs.result.totalCount; //总记录
          that.TotalGuaranteeSlipCount = rs.result.totalGuaranteeSlipCount;
          that.totalPremium = rs.result.totalPremium; //总保费
          that.totalNetPremium = rs.result.totalNetPremium; //净保费
          that.vehicleAndVesselTax = rs.result.vehicleAndVesselTax; //车船税
          this.loading = false;
        } else {
          this.loading = false;
          this.failNot(rs.error.message, "获取失败");
        }
      });
    },
    failNot(message, nametext) {
      this.$notify.error({
        title: nametext,
        message: message,
        duration: 0,
        customClass: "el-notification-error"
      });
    },
    //获取url后满对象
    getquery() {
      let obj = {};
      for (let k in this.formLabel) {
        if (this.formLabel[k] !== "" || this.formLabel[k] === null) {
          obj[k] = this.formLabel[k];
        }
      }
      obj.time = new Date().getTime();
      return obj;
    },
    //页码
    handleCurrentChange(val) {
      Vue.set(this.formLabel, "PageIndex", val);
      let obj = this.getquery();
      this.loading = true;
      console.log(obj);
      this.$router.push({
        name: "policyquery",
        query: obj
      });
    },
    //搜索
    searchList() {
      Vue.set(this.formLabel, "PageIndex", 1);
      let obj = this.getquery();
      console.log(obj);
      //this.loading=true
      this.$router.push({
        name: "policyquery",
        query: obj
      });
    },
    toexport(id) {
      this.$confirm(
        "如果数据量较大，导出会比较慢，建议细化查询条件后再进行导出，您确定要继续导出么?",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }
      )
        .then(() => {
          // const loading = this.$loading({
          //   lock: true,
          //   text: "导出数据中，请不要关闭页面",
          //   spinner: "el-icon-loading",
          //   background: "rgba(0, 0, 0, 0.7)"
          // });
          //this.loading=true
          //this.daochutext="导出数据中，请不要关闭页面"
          let params = this.formLabel;
          params.exportTemplatesid = id;
          this.post(
            params,
            "services/app/guaranteeSlip/ExportGuaranteeSlipFromTemplates"
          ).then(rs => {
            if (rs.success) {
              //this.loading=false
              //this.daochutext=""
              
							//	duration: 0,
						//	loading.close();
							this.notifying = this.$notify({
								title: '导出文件中',
								message: '正在导出，请稍后！',
                iconClass:'el-icon-loading',
                //  duration: 0,
							});
             // console.log(rs.result.filePath);
              // window.location.href = rs.result.filePath;
            //  window.location.href = process.env.BASE_DOWN + rs.result.filePath;
            } else {
              loading.close();
              //this.loading=false
            }
          });
        })
        .catch(() => {});
    },
    toInsurance() {
      let urlnow = window.location.href;
      this.$router.push({
        name: "Insurance",
        params: {
          urlnow: urlnow
        }
      });
    },
    //导出
    toExcel() {
      if (this.checkList.length != 0) {
        this.errortip = false;
        console.log(this.checkList);
        // this.post(this.checkList, 'services/app/guaranteeSlip/GetGuaranteeSlipToExcel').then(rs => {
        // 	if (rs.success) {
        // 		console.log(rs.result);
        // 		this.filePath = rs.result.filePath;
        // 		let url = rs.result.filePath;
        // 		window.location.href = url
        // 	}else{
        // 		this.failNot(re.error.message)
        // 	}
        // })
      } else {
        this.errortip = true;
      }
    },
    toEdit(val) {
      this.$router.push({
        name: "policydetail",
        params: {
          id: val
        }
      });
    },
    toPolicyInsurance() {
      console.log(1);
      this.$router.push({
        name: "policyInsurance"
      });
    },
    // 下拉导出
    downExport() {
      this.post(
        { templateType: 0, isAll: false },
        "services/app/guaranteeSlip/GetExportTemplates"
      ).then(rs => {
        this.dropdownS = rs.result[0].exportTemplates;
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.isExpand,
.isnExpand {
  text-align: center;
  width: 100%;
  position: relative;
}
.isExpand,
.isnExpand {
  p {
    height: 0px;
    display: block;
    border: 0.5px solid #cbcbcb;
    position: relative;
    top: -31px;
    z-index: 0;
  }
  img {
    z-index: 2;
    position: relative;
    cursor: pointer;
  }
}
.isnExpand {
  p {
    top: -23px;
  }
}
.ht80 {
  height: 80px;
}
.wd90 {
  width: 90px;
}
.wd95 {
  width: 95px;
}
.wd130 {
  width: 130px;
}
.wd210 {
  width: 208px;
}
.wd210s {
  width: 300px;
}
.wd180 {
  width: 210px;
}
.wd260 {
  width: 260px;
}
.app-container {
  .policyquery {
    display: table;
    width: 100%;
    background-color: #fff;
    font-size: 13px;
    .tabs {
      width: 100%;
      height: 60px;
      border-bottom: 1px solid #d7d7d7;
      .tabs1 {
        line-height: 50px;
        width: 60px;
        display: inline-block;
        font-size: 16px;
        margin-top: 9px;
        text-align: center;
        margin-left: 20px;
        font-weight: 500;
      }
      .tabs2 {
        line-height: 50px;
        width: 150px;
        display: inline-block;
        font-size: 16px;
        text-align: center;
        margin-left: 20px;
        font-weight: 500;
      }
      //选中
      .now {
        color: #ff8819;
        border-bottom: 2px solid #ff8819;
      }
    }
    .allBox {
      width: 100%;
      height: 100%;
      font-size: 13px;
      .allCon {
        padding: 10px 20px;
        //输入部分
        .importBox {
          //border-bottom:1px solid #d7d7d7;
          position: relative;
          .inputBox {
            width: 100%;
            margin-right: 180px;
            padding: 23px 20px 0;
            .box1 {
              margin: 10px 0 22px 0;
              height: 28px;
              display: flex;
              justify-content: space-between;

              just span {
                margin-right: 20px;
              }
              selectone {
                display: inline-block;
                margin-right: 20px;
              }
              .time1 .util-select {
                width: 110px;
              }
              .search {
                /*float:left;*/
                //  margin-left:7%;
                .util-search {
                  border-color: #d9d9d9;
                  width: 300px;
                }
              }
            }
            .box2 {
              p {
                color: #0099ff;
                font-size: 14px;
              }
              .carInfo {
                .row1 {
                  margin: 22px 0;
                  .lf {
                    /* float:left;*/
                    height: 28px;
                    span {
                      display: inline-block;
                      width: 20px;
                      text-align: center;
                    }
                    input {
                      width: 80px;
                      border: 1px solid #d9d9d9;
                      color: #666;
                      height: 28px;
                      line-height: 28px;
                      padding: 0 11px;
                      border-radius: 5px;
                      background: #fff;
                      outline: none;
                    }
                  }
                  /*.lf:nth-of-type(2){
                      margin:0 15px;
                    }
                    .lf:nth-of-type(3){
                      float:right;
                    }*/
                }

                .row2 {
                  margin: 22px 0;
                  .lf {
                    /*  float:left;*/
                    height: 28px;
                    span {
                      display: inline-block;
                      width: 20px;
                      text-align: center;
                    }
                    input {
                      width: 80px;
                      border: 1px solid #d9d9d9;
                      color: #666;
                      height: 28px;
                      line-height: 28px;
                      padding: 0 11px;
                      border-radius: 5px;
                      background: #fff;
                      outline: none;
                    }
                  }
                  .md {
                    margin: 0 14px;
                    float: left;
                    height: 28px;
                    span {
                      display: inline-block;
                      width: 80px;
                    }
                    input {
                      width: 190px;
                      border: 1px solid #d9d9d9;
                      color: #666;
                      height: 28px;
                      line-height: 28px;
                      padding: 0 11px;
                      border-radius: 5px;
                      background: #fff;
                      outline: none;
                    }
                  }
                  .rh {
                    float: right;
                    height: 28px;
                    span {
                      display: inline-block;
                      width: 80px;
                    }
                    selectone {
                      display: inline-block;
                    }
                    .util-select {
                      width: 190px;
                    }
                  }
                }
              }
            }
            .box3,
            .box4 {
              p {
                color: #0099ff;
                font-size: 14px;
              }
              .searchInfo {
                .row3 {
                  margin: 22px 0 0;
                  .rh {
                    height: 28px;
                    /* float:left;*/
                    span {
                      display: inline-block;
                      width: 80px;
                    }
                    selectone {
                      display: inline-block;
                    }
                    .util-select {
                      width: 190px;
                    }
                  }
                  .rh:nth-of-type(2) {
                    margin: 0 14px;
                  }
                  .rh2 {
                    float: right;
                  }
                }
              }
            }
            .box4 {
              .md {
                span {
                  display: inline-block;
                  width: 80px;
                }
                input {
                  width: 190px;
                  border: 1px solid #d9d9d9;
                  color: #666;
                  height: 28px;
                  line-height: 28px;
                  padding: 0 11px;
                  border-radius: 5px;
                  background: #fff;
                  outline: none;
                }
              }
            }
          }
          .btnBox {
            display: block;
            height: 30px;
            position: absolute;
            bottom: 25px;
            right: 0;
            button {
              min-width: 80px;
            }
            .sea {
              position: absolute;
              right: 90px;
            }
            .out {
              position: absolute;
              right: 0;
            }
          }
          .btnBox2 {
            position: absolute;
            right: 30px;
            top: 31px;
            button {
              min-width: 80px;
            }
          }
        }
        .expandbox {
          width: 100%;
          height: auto;
          transition: all 1s;
        }
        //列表部分
        .totalInfo {
          padding: 1px 0;
          background: #eaf5fb;
          margin: 24px 0 0 0;
          color: #333333;
          position: relative;
          .totalInfo_num {
            color: #cf1322;
            font-weight: 700;
          }
          .totalInfo_nums {
            color: #cf1322;
          }
          .totalInfo_line {
            color: #666;
          }
          p {
            padding-left: 20px;
            font-size: 13px;
            i {
              position: relative;
              top: 1px;
            }
          }
        }
        .listBox {
          .util-table {
            .util-tb {
              width: 100%;
              border-collapse: collapse;
              th {
                border: none;
              }
              tr:nth-child(odd) {
                background-color: #fafafa;
              }
              tr {
                .ht60 {
                  height: 60px;
                }
                .tocenter {
                  text-align: center;
                }
                .util-tab {
                  padding: 10px 8px;
                  .bonbors:not(:last-of-type) {
                    border-bottom: 1px solid #eee !important;
                    line-height: 40px;
                    display: block;
                  }
                  /*.businesscolor a{
						color:#39b96c;
					}*/
                  .allcents {
                    text-align: center;
                  }
                  .toBlock {
                    display: block;
                    margin-bottom: 3px;
                    color: #333;
                  }
                  .companytest {
                    color: #666;
                    cursor: pointer;
                  }
                  .worknumest {
                    cursor: pointer;
                    margin: 0 0 5px 0 !important;
                  }
                  .all {
                    height: 40px;
                    line-height: 40px;
                    border-bottom: 1px solid #eee;
                    i {
                      font-size: 22px;
                    }
                  }
                  .all_worknum {
                    height: 40px;
                    border-bottom: 1px solid #eee;
                    display: flex;
                    flex-direction: column;
                    align-items: flex-start;
                    justify-content: space-around;
                    font-size: 12px;
                    .toBlock {
                      margin-top: 5px;
                    }
                  }
                  .all_worknum:last-child {
                    border-bottom: 0;
                  }
                  .all_equally {
                    margin-right: 0;
                    text-align: center;

                    img {
                      vertical-align: middle;
                      width: 23px;
                      border: 0;
                    }
                  }
                  .all:last-child {
                    border-bottom: 0;
                  }
                  .type1,
                  .type2,
                  .type3,
                  .type4 {
                    i {
                      font-size: 22px;
                      padding: 3px 4px;
                      border-radius: 5px;
                      color: #fff;
                      color: #3c8cbd;
                    }
                  }
                  .type2 {
                    i {
                      color: #39b96c;
                    }
                  }
                  .type3 {
                    i {
                      color: #ff942f;
                    }
                  }
                }
                .util-tabs {
                  height: 60px !important;
                }
                th {
                  background-color: #334750;
                  color: #fff;
                }
                .carId {
                  padding-left: 20px;
                  span {
                    padding: 6px 12px;
                    border-radius: 5px;
                    border: 1px solid rgba(15, 98, 194, 0.5);
                    box-shadow: 0 0 4px #fff inset;
                    min-width: 95px;
                    height: 30px;
                    display: inline-block;
                    text-align: center;
                  }
                }
                .carId5 {
                  span {
                    color: #fff;
                    background-color: #0f62c2;
                  }
                }
                .carId1 {
                  span {
                    background: black;
                    color: white;
                  }
                }
                .carId2 {
                  span {
                    background: white;
                    color: black;
                  }
                }
                .carId3 {
                  span {
                    background: -webkit-linear-gradient(
                      #dae6e2,
                      #059067
                    ); /* Safari 5.1 - 6.0 */
                    background: -o-linear-gradient(
                      #dae6e2,
                      #059067
                    ); /* Opera 11.1 - 12.0 */
                    background: -moz-linear-gradient(
                      #dae6e2,
                      #059067
                    ); /* Firefox 3.6 - 15 */
                    background: linear-gradient(
                      #dae6e2,
                      #059067
                    ); /* 标准的语法 */
                    color: white;
                  }
                }
                .carId4 {
                  span {
                    background: #ffd202;
                    color: black;
                  }
                }
                .carId6 {
                  span {
                    color: #fff;
                    background-color: #0f62c2;
                  }
                }
                //限宽
                .omit {
                  width: 180px;
                  display: block;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  white-space: nowrap;
                }
                .money {
                  text-align: right;
                  div {
                    border-bottom: 1px solid #eee;
                  }
                  div:last-child {
                    border-bottom: 0;
                  }
                }
                .edit,
                .del {
                  color: #027dca;
                  cursor: pointer;
                  font-size: 13px;
                }
                .edits {
                  text-align: center;
                }
                .add {
                  color: #ff0000;
                }
                .dess {
                  color: #03b303;
                }
              }
            }
            .util-tab {
              border-bottom: 1px solid #eee;
              height: 40px;
              color: #333;
            }
          }
          .list-page {
            margin: 30px 0 30px 0;
            display: flex;
            justify-content: flex-end;
          }
        }
      }
    }
  }
}
.compony_text {
  line-height: 20px;
}
.alls {
  cursor: pointer;
  color: #027dca;
  font-weight: 700;
}
.alls:hover {
  color: #027dca;
  text-decoration: underline;
}
.carInfo .clearfixs {
  width: 100%;
  height: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.searchInfo .clearfixs {
  display: flex;
  justify-content: space-between;
}
.show {
  position: relative;
  width: 100%;
  height: 80px;
  transition: all 1.5s;
  overflow: hidden;
  background: white;
}
.hide {
  position: relative;
  overflow: hidden;
  background: white;
  width: 100%;
  height: 360px;
  transition: all 1.5s;
}
.spilname {
  width: 100%;
  height: 60px !important;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-direction: column;
}
.spilname:not(:last-of-type) {
  border-bottom: 1px solid #eee;
}
.spilnames {
  width: 100%;
  height: 60px !important;
  text-align: center;
  line-height: 60px;
  img {
    width: 23px;
    vertical-align: middle;
  }
}
.spilname_right {
  height: 60px !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.spilname_cen {
  height: 60px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spilname_ben {
  height: 60px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.verser {
  overflow: inherit;
}
.addlabel {
  width: 78px;
  font-size: 13px;
  display: inline-block;
  line-height: 28px;
  color: #666;
  font-weight: 400;
}
@media screen and (min-width: 0) and (max-width: 1380px) {
  .wd180 {
    width: 145px;
  }
  .media {
    position: relative;
    left: -30px;
  }
}
</style>